************************************************************************
*Replication files for: "Promoting Information and Visual Literacy Skills in Undergraduate Students Using Infographics"
*Date: 09/30/2022
************************************************************************

*requires installation of schemepack 
*if schemepack is needed use:
*ssc install schemepack, replace
*OR
*net install schemepack, from("https://raw.githubusercontent.com/asjadnaqvi/Stata-schemes/main/schemes/") replace

*********************************
*** Begin Log
*********************************
log using "infographicdata_replication_log.log"


*********************************
*** Load Data
*********************************

use "infographicdata_replication.dta"


*********************************
*** Codebook View in Stata
*********************************
codebook

*********************************
*** Create figure 2
*********************************

*create box plots of variables of interest

graph box understandscholarly-trust , ///
	title("Student Perceptions of Infographics as a Tool") legend(position(6))


*********************************
*** Create figure 1 
*********************************

*save data to use for each figure
save tokendata, replace 

*use statsby to plot means by pre-/post-test with confidence intervals
statsby , by(posttest) : ci means criticalthink, level(90)
gen which = "Critical Thinking" 
save ciresults, replace 

u tokendata 
statsby , by(posttest) : ci means learninfo, level(90)
gen which = "Learn New Information" 
save ciresults2, replace 

u tokendata 
statsby , by(posttest) : ci means confidence, level(90)
gen which = "Self-Confidence in Learning" 
save ciresults3, replace 

u tokendata 
statsby , by(posttest) : ci means presentskills, level(90)
gen which = "Presentation Skills" 
append using ciresults
append using ciresults2 
append using ciresults3
 
*encode which
encode which, gen(Which) 

*list numeric means in figure
gen toshow = string(mean, "%3.2f") 
gen yshow = 4.6 

*create figure
set scheme white_tableau
twoway scatter mean posttest, xsc(r(-0.2 1.2)) yla(, ang(h)) ///
|| scatter yshow posttest, ms(none) mlabpos(0) mlabsize(medium) mla(toshow) ///
|| rcap ub lb posttest , by(which, note("") legend(off) title("Differences in Perceived Learning with Infographic Assignment")) xla(0 "Pre-Test" 1 "Post-Test") xtitle("") 


*********************************
*** End Log
*********************************
log close
